/*
 * Copyright (c) 2025 Huawei Technologies Co., Ltd.
 * openFuyao is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *          http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

package k8s

import (
	"testing"
)

func TestNewKubernetesClient(t *testing.T) {
	type args struct {
		cfg *KubernetesCfg
	}
	tests := []struct {
		name    string
		args    args
		want    Client
		wantErr bool
	}{
		{
			name: "default",
			args: args{
				cfg: &KubernetesCfg{
					KubeConfigFile: getKubeConfigFile(),
					KubeConfig:     GetKubeConfig(),
					QPS:            1e6,
					Burst:          1e6,
				},
			},
			want: &kubernetesClient{
				k8s:      nil, // Will be set in NewForConfig
				snapshot: nil, // Will be set in NewForConfig
				api:      nil, // Will be set in NewForConfig
				cfg:      GetKubeConfig(),
			},
			wantErr: false,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			_, err := NewKubernetesClient(tt.args.cfg)
			if (err != nil) != tt.wantErr {
				t.Errorf("NewKubernetesClient() error = %v, wantErr %v", err, tt.wantErr)
				return
			}
		})
	}
}
